package com.djl.zenithbite.common.threadlocal;

import com.djl.zenithbite.entity.User;

public class UserContextHolder {

    /**
     * init user
     * @param user
     */
    public static void init(User user){
        UserContext.setUser(user);
    }

    public static String getUserName(){
      return UserContext.getUser().getUserName();
    }

    public static String getUserId(){
       return UserContext.getUser().getUserId();
    }

    public static Integer getUserPrimaryId(){
        return UserContext.getUser().getId();
    }

    public static User getUser(){
        return UserContext.getUser();
    }

    public static void clear(){
        UserContext.clear();
    }
}
